import './loginValidate.less'
import {getCookie} from '../../js/common/utils'
import {wxLoginBack} from '../../js/common/api'
export function isLogined(backfun) {
  if (!getCookie('logined')) {
    if(!getCookie('logout')) {
      wxLoginBack()
    } else {
      location.href = `login.html?href=${location.href}&ubind=true`
    }
  } else {
    document.body.setAttribute('login',new Date().getTime())
    typeof backfun === 'function' && backfun()
  }
}
